﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenCvSharp;

namespace ViewROI
{
    public struct Center
    {
        public float X;
        public float Y;
    }

    public class Rectangle2
    {
    
        public RotatedRect rotatedRect;
        public Center center;
        public float angle;
        public float width;
        public float height;
        public Rectangle2(double midR, double midC, double phi, double length1, double length2)
        {
            rotatedRect = new RotatedRect(new Point2f((float)midC, (float)midR), 
                new Size2f((float)length1 * 2, (float)length2 * 2), -(float)(phi * 180 / Math.PI));
            center.X = rotatedRect.Center.X;
            center.Y = rotatedRect.Center.Y;
            angle = rotatedRect.Angle;
            width = rotatedRect.Size.Width;
            height = rotatedRect.Size.Height;
        }

        public Rectangle2()
        {
            //rotatedRect = new RotatedRect(new Point2f((float), (float)midC), new Size2f(length1, length2), (float)phi);
        }
    }
}
